from tkinter import *
# 2021-06-16 16:10 by 炸天帮成员

def retrieve():
    print('Var1.get() = ',Var1.get())
    print('Var2.get() = ',Var2.get())
 
root = Tk()
root.geometry("200x150")
 
frame = Frame(root)
frame.pack()
 
Var1 = IntVar()
Var2 = IntVar()
 
ChkBttn = Checkbutton(frame, width = 15, text = "选择一",variable = Var1,command = retrieve)
ChkBttn.pack(padx = 5, pady = 5)
 
ChkBttn2 = Checkbutton(frame, width = 15, text = "选择二",variable = Var2,command = retrieve)
ChkBttn2.pack(padx = 5, pady = 5)

root.mainloop()